//博客前台文章详情展示页面
const { Article } = require('../../model/article');
const { Comment } = require('../../model/comment');
module.exports = async(req, res) => {
    const id = req.query.id;
    let article = JSON.parse(JSON.stringify(await (Article.findOne({ _id: id })).populate('author')));
    let comments = JSON.parse(JSON.stringify(await Comment.find({ aid: id }).populate('uid')));
    res.render('home/article', { article, comments });
}